#include <stdio.h>

double fn( double x, int n );

int main()
{
    double x;
    int n;

    scanf("%lf %d", &x, &n);
    printf("%.2f\n", fn(x,n));

    return 0;
}

/* 你的代码将被嵌在这里 */

double fn ( double x, int n ) {
    double sum, pow = 1;
    int i;
    for ( i = 1; i <= n; i++ ) {
        pow*=x;
    }
    if ( n < 1 ) {
        sum = 0;
    } else if ( n > 1 ) {
        if ( n % 2 == 1 ) {
            sum = fn (x,n-1) + pow;
        } else {
            sum = fn (x,n-1) - pow;
        }
    } else {
        sum = x;
    }
    return sum;
}